#ifndef DATAMANAGERSINGLETON_H
#define DATAMANAGERSINGLETON_H
#include <mlt++/Mlt.h>
#include <iostream>
#include <QList>
#include <QPalette>
#include <QThread>
#include <QString>

using namespace std;

//typedef struct Extraction;
struct Extraction{
	int start;
	int end;
};

class DataManagerSingleton{
	public:
	~DataManagerSingleton();
	void initializeMlt(int widgetId);
	void openVideo(QString fileName);
	void addExtraction(int position);
	void removeExtraction(int indice);
	Extraction getExtraction(int indice);
	void changeExtraction(int rowIndex);
	void play();
	void pause();
	static DataManagerSingleton *getInstance();
	void stopConsumer();
	int getFps();
	int getLengthVideo();
	void setExtraction(int indice, Extraction newExtraction);
	void seek(int frame);
	int getPosition();
	void saveExtractions(QString fileName);

	private:
	int fps;
	static DataManagerSingleton *instance;
	DataManagerSingleton();
	QList<Extraction> *extractions;
	Mlt::Profile *m_profile;
	Mlt::Consumer *m_consumer;
	Mlt::Producer *m_producer;
	QString inFileName;
};

#endif

